#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

class Solution{
    public:
    int ans1(int n){
        int counts = 0;
        while(n > 0){
            if(n % 2 == 1){
                counts++;
            }
            n = n / 2;
        }
        return counts;
    }

};

void test1(){
    Solution s;
    int n = 11;

    int ret = s.ans1(n);
    cout << ret << endl;
}

void test2(){
    Solution s;
    int n = 128;

    int ret = s.ans1(n);
    cout << ret << endl;
}

void test3(){
    Solution s;
    int n = 2147483645;

    int ret = s.ans1(n);
    cout << ret << endl;
}

int main(void){
    test1();
    test2();
    test3();

    return 0;
}